/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.zookeeper.CuratorManager;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class SetLocalServerOnline
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 34 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 35 */     checkRight(zsc, context, null, AdminRight.PR_SYSTEM_ADMIN_ONLY);
/* 36 */     Element response = zsc.createElement(AdminConstants.SET_LOCAL_SERVER_ONLINE_RESPONSE);
/* 37 */     CuratorManager curator = CuratorManager.getInstance();
/* 38 */     if (curator == null) {
/* 39 */       return response;
/*    */     }
/*    */     try {
/* 42 */       curator.registerLocalService();
/*    */     } catch (Exception e) {
/* 44 */       throw ServiceException.FAILURE("error while register the local server", e);
/*    */     }
/* 46 */     return response;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 51 */     notes.add("Only system admins are allowed.");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/SetLocalServerOnline.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */